public class LCP25 {
    public int keyboard(int k, int n) {
        long[] level = new long[n];
        long[] times = new long[n];
        long result = 0;
        level[0]=1;
        for(int i=1;i<n;i++){
            level[i]=i*level[i-1];
        }
        //i表示空位数
        for(int i=0;i<n;i++){
            times[i]=level[n-1]/(level[n-1-i]*level[i])*(long) Math.pow(25,i);
        }
        int index = n-k;
        if(index<0){
            index=0;
        }
        for(int i=index;i<n;i++){
            result+=times[i];
            result%=1000000007L;
        }
        result*=26;
        result%=1000000007L;
        return (int) result;
    }
}
